<% reader_wrapper @aggregation, @page do -%>
    <% if @next_page == '1' -%> 
        <% if params[:action] == 'marked' || params[:action] == 'show_marked' -%>
            <li class="photos"><%=link_to 'Photos', {:controller => 'aggregations', :action => 'marked_photos', :user_id => current_user.id}, {:title => "View photos extracted from your marked entries"} %></li>
        <% elsif params[:action] == 'all' -%>
            <li class="photos"><%=link_to 'Photos', {:controller => 'aggregations', :action => 'all_photos', :user_id => current_user.id}, {:title => "View photos extracted from all your entries"} %></li>
        <% elsif params[:action] == 'read' -%>
            <li class="photos"><%=link_to 'Photos', {:controller => 'aggregations', :action => 'read_photos', :user_id => current_user.id}, {:title => "View photos extracted from the entries you have read"} %></li>
        <% else -%>
            <li class="photos"><%=link_to 'Photos', {:controller => 'aggregations', :action => 'photos', :user_id => current_user.id}, {:title => "View photos extracted from #{@aggregation.title}"} %></li>
						<li class="bookmarks"><%=link_to 'Bookmarks', {:controller => 'aggregations', :action => 'bookmarks'}, {:title => "View bookmarks extracted from #{@aggregation.title}"} %></li>
						<li class="marked"><%=link_to 'Marked Entries', {:controller => 'aggregations', :action => 'show_marked', :user_id => current_user.id}, {:title => 'View entries that you marked for this aggregation'} %></li>
        <% end -%>      
    <% end -%>  
    <% for entry in @entries -%>
        <li id="<%=entry.id%>" class="<%=entry.unread=="t" ? 'unread' : 'read'%>"><%=link_to entry.title, 
              {:controller=>'entries', :action => 'show', :id => entry.id, :aggregation_id => @aggregation.id}, 
              {:target => '_self', :title => 'View ' + entry.title, :onclick => 'read(' + entry.id.to_s + ')'}%>
            <p class="via">(via <%=entry.feed_title%>)</p>
        </li>
    <% end -%>
    <% if @entries.empty? -%>
        <li>No More Stories</li>
    <% else -%>
        <% if @entries.length >= @per_page -%>
            <li style="color:slateblue;"><%=link_to 'Get ' + @per_page.to_s + ' More Stories...', {:action => params[:action], :page => @next_page}, {:target => '_replace', :title => 'Get ' + @per_page.to_s + ' more stories'} %></li>
        <% end -%>
    <% end -%>
<% end -%>